#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
int x,y;
int main(void){
    while(~scanf("%d%d",&x,&y)){
        if(x>y){
            int t=x;
            x=y;
            y=t;
        }
        int a=0;
        int b=0;
        for(int i=x;i<=y;i++){
            if(i%2==0){
                a+=i*i;
            }
            else{
                b+=i*i*i;
            }
        }
        printf("%d %d\n",a,b);
    }
    return 0;
}
